<template>
    <div class="goods-item">
        <img :src="product.url" alt="">
        <div class="goods-info">
            <p>{{product.title}}</p>
            <span class="price"><small>￥</small>{{product.price}}</span>
            <span class="collect">
                <i class="el-icon-star-off"></i>
                <span>{{product.collectcount}}</span>
            </span>
        </div>
    </div>
</template>

<script>
import { reactive, toRefs } from 'vue'

export default {
    props:{
        product: Object,
        default () {
            return {}
        }
    },
    setup () {
        const state = reactive({
            count: 0
        })
    
        return {
            ...toRefs(state)
        }
    }
}
</script>

<style lang="scss" scoped>
.goods-item{
    width: 46%;
    padding-bottom: 40px;
    position: relative;
    img{
        width:100%;
        border-radius: 5px;
    }
    .goods-info{
        font-size: 12px;
        position: absolute;
        bottom: 5px;
        left: 0;
        right: 0;
        overflow: hidden;
        text-align: center;
        p{
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            margin-bottom: 3px;
        }
        .price{
            color: red;
            margin-right: 20px;

        }
        .collect{
            position: relative;

        }
    }
}
</style>